package com.bbex.mapper;

import com.bbex.entity.DepositHidAddress;
import com.bbex.sql.build.DepositHidAddressSqlBuild;
import org.apache.ibatis.annotations.*;

@Mapper
public interface DepositHidAddressDao {

    @InsertProvider(type = DepositHidAddressSqlBuild.class, method = "insert")
    void insert(DepositHidAddress withdrawAddress);

    @SelectProvider(type = DepositHidAddressSqlBuild.class, method = "findById")
    DepositHidAddress findById(String id);

    @UpdateProvider(type = DepositHidAddressSqlBuild.class, method = "updateById")
    long updateById(DepositHidAddress withdrawAddress);

    @Select("select " + DepositHidAddressSqlBuild.columns + " from hongmeng_user_deposit_hid_address where user_id =#{userId} and coin_id = #{coinId} limit 1")
    DepositHidAddress findByUserIdAndCoinId(@Param("userId") String userId, @Param("coinId") String coinId);

    @Select("select " + DepositHidAddressSqlBuild.columns + " from hongmeng_user_deposit_hid_address where address =#{address} limit 1")
    DepositHidAddress findByAddress(@Param("address") String address);

}
